home *** CD-ROM | disk | FTP | other *** search
/ Aminet 12 / Aminet 12 (1996)(GTI - Schatztruhe)[!][Jun 1996].iso / Aminet / misc / edu / Calgor.lha / Cal / Algorithms / For.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-19  |  1.1 KB  |  36 lines

  1. #include<hold/anim.h>
  2.  
  3. /* 000 */ void for_control(void){
  4. /* 001 */ int count = 0;
  5. /* 002 */ int j = 0;
  6.  
  7.           a_func("for_control",0);
  8.           a_intini(count,"count",1);
  9.           a_intini(j,"j",2);
  10.           a_intass("count","0",3);
  11.           a_intcomp("count<3",3);
  12. /* 003 */   for(count=0;count<3;count++){
  13. /* 004 */     j = count;
  14.               a_intass("j","count",4);
  15.               a_intass("count","count+1",3);
  16.               a_intcomp("count<3",3);
  17. /* 005 */   }
  18.             a_intass("count","3",6);
  19.             a_intcomp("count==0",6);
  20. /* 006 */   for(count=3;count==0;count--){
  21. /* 007 */     j = count;
  22.               a_intass("j","count",7);
  23.               a_intass("count","count-1",6);
  24.               a_intcomp("count==0",6);
  25. /* 008 */   }
  26.             a_intass("count","3",9);
  27.             a_intcomp("count>0",9);
  28. /* 009 */   for(count=3;count>0;count--){
  29. /* 010 */     j = count;
  30.               a_intass("j","count",10);
  31.               a_intass("count","count-1",9);
  32.               a_intcomp("count>0",9);
  33. /* 011 */   }
  34.             a_endfunc("for_control",12);
  35. /* 012 */ }
  36.